package edu.iyte.ceng316.model.data;

import java.util.ArrayList;
import java.util.List;

import edu.iyte.ceng316.model.AbstractModelObject;
import edu.iyte.ceng316.model.Person;
import edu.iyte.ceng316.model.PhoneGroup;
import edu.iyte.ceng316.model.PhoneGroups;


public class PhoneBookManager implements IPhoneBookModel{
	
	private PhoneGroups phoneGroups;
	private List<String> departmentNames;
	private PhoneGroup phoneGroup;
	
	public PhoneBookManager(){
	  phoneGroups = new PhoneGroups();
	  departmentNames = new ArrayList<String>();
	  phoneGroup = new PhoneGroup();
	}
	
	public List<PhoneGroup> getPhoneGroups() {
		return phoneGroups.getGroups();
	}

	public PhoneGroups getGroups() {
		return phoneGroups;
	}

	public List<String> getDepartmentNames() {
		return departmentNames;
	}
	
	public List<Person> getPersons() {
		return phoneGroup.getPersons();
	}

	public void initialize() {
		PhoneGroup group1 = new PhoneGroup("Developer Team");
		phoneGroups.addGroup(group1);
		group1.addPerson(new Person("Konstantin Scheglov", "kosta@nospam.com",
				"1234567890", "", ""));
		group1.addPerson(new Person("Alexander Mitin", "mitin@nospam.com", "",
				"0987654321", ""));
		group1.addPerson(new Person("Alexander Lobas", "lobas@nospam.com", "",
				"", "111-222-333-00"));
		group1.addPerson(new Person("Andey Sablin", "sablin@nospam.com",
				"098765", "", "aaa-vvv-ddd"));
		//
		PhoneGroup group2 = new PhoneGroup("Management Team");
		phoneGroups.addGroup(group2);
		group2.addPerson(new Person("Mike Taylor", "taylor@instantiations.com",
				"503-598-4900", "", ""));
		group2.addPerson(new Person("Eric Clayberg",
				"clayberg@instantiations.com", "+1 (503) 598-4900", "", ""));
		group2.addPerson(new Person("Dan Rubel", "dan@instantiations.com",
				"503-598-4900", "", ""));
		//
		PhoneGroup group3 = new PhoneGroup("Support Team");
		phoneGroups.addGroup(group3);
		group3.addPerson(new Person("Gina Nebling",
				"support@instantiations.com", "800-808-3737", "", ""));
		//
		departmentNames.add("Developer Team");
		departmentNames.add("Management Team");
		departmentNames.add("Support Team");
		departmentNames.add("Test Group's");
		departmentNames.add("Sales department");
		departmentNames.add("PR department");
		departmentNames.add("Advertising department");
		
	}
	
}
